<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>
		<s:text name="applcation.name"/>
	</title>
	
	<link rel="stylesheet" href="<%=request.getContextPath() %>/jquery-bundle/themes/base/jquery.ui.all.css">
	<link rel="stylesheet" href="<%=request.getContextPath() %>/jquery-bundle/demos/demos.css">
	<script src="<%=request.getContextPath() %>/jquery-bundle/jquery-1.5.1.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/external/jquery.bgiframe-2.1.2.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.core.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.widget.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.mouse.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.draggable.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.position.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.resizable.js"></script>
	<script src="<%=request.getContextPath() %>/jquery-bundle/ui/jquery.ui.dialog.js"></script>
	
	<script language="javascript" type="text/javascript" src="<%=request.getContextPath() %>/js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript">
		 String.prototype.trim=function(){
		   return this.replace(/(^\s*)|(\s*$)/g, "");
		 };
		 String.prototype.ltrim=function(){
		    return this.replace(/(^\s*)/g,"");
		 };
		 String.prototype.rtrim=function(){
			return this.replace(/(\s*$)/g,"");
		 };
	</script>
          
    <script type="text/javascript">
	<!--
	function doSave(){
	    var errorMsg = "";
		if($("#relativeFlightNo").val().trim()=="" || $("#relativeStation").val().trim()=="" || $("#stateChangeTime").val().trim()==""){
			errorMsg = '<s:text name="dialog.message.tip.needRequiredFields"/>' ;
		}
		
		if(errorMsg != ""){
			$("#tip-message").html(errorMsg);
			$("#dialog:ui-dialog").dialog( "destroy" );
			$( "#dialog-message" ).dialog({
				modal: true,
				buttons: {
					Ok: function() {
						$(this).dialog( "close" );
					}
				}
			});
			return;
		}
		
		$("#addSAStateHisForm").submit();
	}
	
	function doClose(){
		window.close();
	}
	//-->
     </script>
</head>

<body>
  <div class="demo" >
	<div id="dialog-message" title="<s:text name="dialog.message.title"/>" style="display: none;">
		<p>
			<span id="tip-message">
			</span>
		</p>
	</div>
  </div>
  <s:form id="addSAStateHisForm" action="SaMgr_addSAStateHis">
  	    <div align="center">
  	    	<h4>Add SLV Station</h4>
	    </div>
       	<div align="left">
			<s:actionmessage cssStyle="color:#0000FF;"/>
	   </div>
  	   <s:hidden key="editSaId"/>
	   <table width="60%" align="center"  >
	   		<tr >
	   			<td>Relative FlightNo:</td>
	   			<td><s:textfield id="relativeFlightNo" name="relativeFlightNo" cssStyle="width: 4cm;"/></td>
	   		</tr>
	   		<tr >
	   			<td>Relative Station:</td>
	   			<td><s:textfield id="relativeStation" name="relativeStation" cssStyle="width: 4cm;"/></td>
	   		</tr>
	   		<tr >
	   			<td>State Change Time:</td>
	   			<td>
	   			<s:textfield id="stateChangeTime" name="stateChangeTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',readOnly:true,lang:'en'})"> 
			    </s:textfield>
			    </td>
	   		</tr>
	   		<tr>
	   			<td colspan="2" align="center">
	   			    <input type="button" class="btn" value="Save" onclick="doSave()">
	   			    <input type="button" class="btn" value="Close" onclick="doClose()">
	   			</td>
	   		</tr>
	   </table>
  </s:form>
</body>
</html>
